package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"
	"ssdevice/internal/device/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerDeviceTaskRouter)
}

func registerDeviceTaskRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.DeviceTask{}
	// 设备安装包
	r := v1.Group("/api/dev/package").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindPackageList)
	}

	// 设备任务
	r2 := v1.Group("/api/dev/task").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r2.GET("/find", api.FindTaskList)
	}

	// 任务详情设备列表
	r3 := v1.Group("/api/task/device").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r3.GET("/find", api.FindTaskDeviceList)
	}
}
